define(function(require, exports){
  'use strict';
  var _const = require('seajs/fn/fnConst');
  var $ = require('seajs/jquery.min');
  require('seajs/plugs/jquery.md5')($); 
  var fnUtils = require('seajs/fn/fnUtils');
  var fnData = require('seajs/fn/fnData');
  var Task = require('seajs/fn/fnTask');
  var fnError = require('seajs/fn/fnErrorHandler');
  var fnModal = require('seajs/fn/fnModal');


 /***************************************
 **********  MSG 数据组装 Start *********
 ****************************************/
 
  var getAccessMsg = function(cmpid, uid, pwd){
    if(cmpid && uid && pwd ){
      var ts = new Date().getTime();
      var tmp = cmpid + pwd + ts + _const.DEVICE.DISPATCHER + uid + _const.FN_KEY;
      return {
        cmpid: cmpid,
        ts: ts,
        type: _const.DEVICE.DISPATCHER,
        uid: uid,
        pwd: $.md5(tmp.toUpperCase())
      }
    }else{
      console.log('参数有错');
    }
  }

  var getHeartBeatMsg = function(cmpid, uid , token){
    if(cmpid && uid){
      return {
        cmpid: cmpid,
        uid: uid,
        token: token
      }
    }
  }

  var getInChannelMsg = function(cmpid, uid, gid, type){
    if(cmpid && uid && gid){
      return {
        cmpid: cmpid,
        uid: uid, 
        gid: gid,
        type: type
      }
    }
  }

  var getOutChannelMsg = function(cmpid, uid){
    if(cmpid && uid ){
      return {
        cmpid: cmpid,
        uid: uid
      }
    }
  }

  var getVideoSingleCallMsg = function(cmpid, eruid, eduid, gid){
    if(cmpid && eruid && eduid){
      return {
        cmpid: cmpid,
        eruid: eruid, 
        eduid: eduid,
        gid: gid
      }
    }
  }

  var get_videoSingleCallHangUpMsg = function(cid, sid, err){
    if(cid && sid){
      return {
        err: err,
        cid: cid, 
        sid: sid
      }
    }
  }

  var getVideoSingleCallHangUpMsg = function(cid, sid, uid, gid){
    if(cid && sid && uid && gid){
      return {
        cid: cid, 
        sid: sid,
        uid: uid,
        gid: gid
      }
    }
  }

  var getBoardcastMsg = function(cmpid, uid, gid){
    if(uid && cmpid && gid){
      return {
        uid: uid,
        cmpid: cmpid, 
        gid: gid
      }
    }
  }

  var getBoardcastHangUpMsg = function(cid, sid, uid, gid){
    if(cid && sid && uid && gid){
      return {
        cid: cid, 
        sid: sid,
        uid: uid,
        gid: gid
      }
    }
  }

  var getTemporaryTalkMsg = function(cmpid, uid, gid){
    if(uid && cmpid && gid){
      return {
        eruid: uid,
        cmpid: cmpid, 
        gid: gid
      }
    }
  }

  var getTemporaryTalkHangUpMsg = function(cid, sid, uid, gid){
    if(cid && sid && uid && gid){
      return {
        cid: cid, 
        sid: sid,
        uid: uid,
        gid: gid
      }
    }
  }

  var getTemporaryTalkAddMsg = function(cmpid, uid, gid, uids){
    if(cmpid && uid && gid && uids){
      return {
        cmpid: cmpid,
        eruid: uid, 
        gid: gid,
        uids: uids
      }
    }
  }

  var getPushLbsMsg = function(cmpid, uid, lng, lat){
    if(cmpid && uid && lng && lat){
      return {
        cmpid: cmpid, 
        uid: uid,
        lng: lng,
        lat: lat
      }
    }
  }

  var getRTPMsg = function(cmd, sid, cid, uid, destip, destport, payloadtype, sendflag){
    if(cmd && sid && cid && uid && destip && destport && payloadtype && sendflag){
      return {
        cmd: cmd,
        sid: sid,
        cid: cid,
        uid: uid,
        destip: destip,
        destport: destport,
        payloadtype: payloadtype,
        sendflag: sendflag
      }
    }
  }

  var getOtherMsg = function(){
    if(_const.debug){
      console.log('=========== getOtherMsg() ==========');
    }
  }
 
 /***************************************
 **********  MSG 数据组装 end *********
 ****************************************/
  // 8001
  var accessHandler = function(container, msg){
    if(!container){
      return false;
    }
    if(msg.body.err === _const.WS.RLT.OK){
      //加入默认组
      if(container.slidebar !== undefined 
        && container.slidebar.defaultGroup !== undefined){
        if(container.isInitFlag){
          container.joinGroup(container.slidebar.joinedGroup, _const.PTT_TYPE.TALKING);
        }else{
          container.isInitFlag = true;
          container.slidebar.checkR(container.slidebar.defaultGroup);
        }
      }
    }else{
      $('.danger-bar-info').html(fnError.wsError(msg.body.err) + ',点击确定系统登出!');
      $('#returnLoginModal').modal('show');
    }
  }

  //8002
  var heartBeatHandler = function(container, msg){
  	if(_const.debug){
      console.log('=========== heartBeatHandler() ==========');
  	}
    if(msg.body.err === 10011){
      fnUtils.exitDispatcher(container);
      $('.danger-bar-info').html('账户在其它地方登陆, 点击确定返回登陆界面!');
      console.log(msg);
      $('#returnLoginModal').modal('show');
    }
  }

  // 8013
  var _stashPopHandler = function(container, msg){
    if(msg){
      var aip = msg.body.aip;
      var aport = msg.body.aport;
      var atype = msg.body.atype;
      var cid = msg.body.cid;
      var gid = msg.body.gid;
      var sid = msg.body.sid;
      var type = msg.body.type;
      var stat = msg.body.stat;
      container.currentGid = gid;
      switch(type){
        case _const.PTT_TYPE.TALKING:
        var group = container.slidebar.groupMap.get(gid);
          if(group){
            container.slidebar.groupRadioOffChangedByGid(gid);
            $('#group_radio_' + gid).iCheck('check');
            $('#main_bottom_left_voice_obj').html(fnUtils.contentFormat(group.groupName, 6, 2));
            container.slidebar.groupRadioOnChangedByGid(gid);
            container.isInitFlag = true;
          }
          break;
        case _const.PTT_TYPE.BOARDCAST:
          var task = new Task(container.currentGid);
          task.setTopic('广播');
          task.setEventType(_const.TASK_TYPE.BOARDCAST);
          task.cid = cid;
          task.sid = sid;
          container.tasks.put(task);
          break;
        case _const.PTT_TYPE.SINGLE_CALL:
          var task = new Task(container.currentGid);
          task.setTopic('单呼');
          task.setEventType(_const.TASK_TYPE.SINGLE_CALL);
          task.cid = cid;
          task.sid = sid;
          container.tasks.put(task);
          break;
        case _const.PTT_TYPE.TEMPORARY_GROUP:
          var task = new Task(container.currentGid);
          task.setTopic('临时对讲');
          task.setEventType(_const.TASK_TYPE.TEMPORARY_GROUP);
          task.cid = cid;
          task.sid = sid;
          container.tasks.put(task);
          break;
        default:
      }
      // 加入RTP对讲
      container.cid = msg.body.cid;
      container.sid = msg.body.sid;
      container.rtpWs.cid = msg.body.cid;
      container.rtpWs.sid = msg.body.sid;
      container.rtpWs.destip = msg.body.aip;
      container.rtpWs.destport = msg.body.aport;
      container.rtpWs.payloadtype = _const.RTP_WS.PARAM.PAY_LOAD_TYPE;
      container.rtpWs.accessRtp(0);
    }
  }

  // 8003
  var inChannelHandler = function(container, msg){

    if(msg){
      var aip = msg.body.aip;
      var aport = msg.body.aport;
      var atype = msg.body.atype;
      var cid = msg.body.cid;
      var gid = msg.body.gid;
      var sid = msg.body.sid;
      var type = msg.body.type;
      var stat = msg.body.stat;

      switch(type){
        case _const.PTT_TYPE.TALKING:
          container.slidebar.setJoinedGroup(container.uid, gid);
          break;
        case _const.PTT_TYPE.BOARDCAST:
          var task = container.tasks.taskMap.get(gid);
          if(task){
            task.cid = msg.body.cid;
            task.sid = msg.body.sid;
          }
          break;
        case _const.PTT_TYPE.SINGLE_CALL:
          var task = container.tasks.taskMap.get(gid);
          if(task){
            task.cid = msg.body.cid;
            task.sid = msg.body.sid;
          }
          break;
        case _const.PTT_TYPE.TEMPORARY_GROUP:
          var task = container.tasks.taskMap.get(gid);
          if(task){
            task.cid = msg.body.cid;
            task.sid = msg.body.sid;
          }
          break;
        default:
      }

      // 加入RTP对讲
      container.cid = msg.body.cid;
      container.sid = msg.body.sid;
      container.rtpWs.cid = msg.body.cid;
      container.rtpWs.sid = msg.body.sid;
      container.rtpWs.destip = msg.body.aip;
      container.rtpWs.destport = msg.body.aport;
      container.rtpWs.payloadtype = _const.RTP_WS.PARAM.PAY_LOAD_TYPE;
      container.rtpWs.accessRtp(0);
    }
  }

  var outChannelHandler = function(container, msg){
    if(msg.body.err === _const.WS.RLT.OK){
      if(container.rtpWs.ws.readyState == WebSocket.OPEN){
        container.rtpWs.exitRtp();
      }
    }
  }

  var videoSingleCallHandler = function(container, msg){

    if(msg.body.err === _const.WS.RLT.OK){
      container.currentGid = msg.body.gid;
     
      var task = new Task(container.currentGid);
      task.setTopic('单呼');
      task.setEventType(_const.TASK_TYPE.SINGLE_CALL);
      container.tasks.put(task);

      container.joinGroup(container.currentGid, _const.PTT_TYPE.SINGLE_CALL);
    }else if(msg.body.err === 10006){

      //$('#tg_select_alert_error').css('display', 'block');
      $('#function-alert').html('用户忙,请稍后在进行操作').fadeIn(200,function(){
        setTimeout(function(){
          $('#function-alert').fadeOut(500);
        },1000)
      })
    }else if(msg.body.err === 10005){
      $('#function-alert').html('用户权限低 ,无法进行此操作').fadeIn(200,function(){
        setTimeout(function(){
          $('#function-alert').fadeOut(500);
        },1000)
      })
    }
  }

  var videoSingleCallHangUpHandler = function(container, msg){
    if(msg.body.err === _const.WS.RLT.OK){
      container.tasks.remove(msg.body.gid);
      container.exitGroup();
      container.joinBeforeGroup();
      container.tasks.singleCalledUid = undefined;
    }
  }

  var _videoSingleCallHangUpHandler = function(container, msg,groupName){
    container.tasks.remove(msg.body.gid);
    container.exitGroup();
    container.joinBeforeGroup();
    $('#active-group').html('当前群组');
    $('#main_bottom_left_voice_obj1').html(container.tasks.singleCallName);
  }

  //15
  var pullLbsHandler = function(container, msg){
    if(msg.body && msg.body.lat 
      && msg.body.lng && msg.body.uid){
      var lat = msg.body.lat;
      var lng = msg.body.lng;
      var uid = msg.body.uid;
      var positionTime = fnUtils.unixTimeFormat(msg.body.createtime);
      if(!container.slidebar.clickUid[uid]){container.slidebar.clickUid[uid]={};}
      container.slidebar.clickUid[uid].positionTime=positionTime;
      container.slidebar.clickUid[uid].latLng=[lng,lat];
      //container.slidebar.positionTime=positionTime;
      //container.slidebar.latLng=[lng,lat];

      if(container.slidebar && container.slidebar.memberMap.get(uid)){
        container.slidebar.memberMap.get(uid)['position'] = [lng, lat];
        if(container.showMarkerMap.get(uid)){
          container.showMarkerMap.get(uid).setPosition(new AMap.LngLat(lng, lat));
        }
      }

      $('#lat_' + uid).html(fnUtils.formatDouble(lat,6));
      $('#lng_' + uid).html(fnUtils.formatDouble(lng, 6));
      $('#position_time_' + uid).html(positionTime);
    }
  }

  var boardcastHandler = function(container, msg){
    if(msg.body.err === _const.WS.RLT.OK){

      container.currentGid = msg.body.gid;
     
      var task = new Task(container.currentGid);
      task.setTopic('广播');
      task.setEventType(_const.TASK_TYPE.BOARDCAST);
      container.tasks.put(task);

      container.tasks.boardcast.isCreated = true;
      container.joinGroup(container.currentGid, _const.PTT_TYPE.BOARDCAST);
      $('#boardcast').modal('hide');
    }else{
      container.tasks.boardcast.hideAlert();
      container.tasks.boardcast.hideAlertError(fnError.wsError(msg.body.err));
    }
  }

  var boardcastHangUpHandler = function(container, msg){
    if(msg.body.err === _const.WS.RLT.OK){
     container.tasks.remove(msg.body.gid);
     container.exitGroup();
     container.joinBeforeGroup();
    }
  }

  var temporaryTalkHandler = function(container, msg){
    if(msg.body.err === _const.WS.RLT.OK){
      container.currentGid = msg.body.gid;
      var stat = msg.body.stat;
      container.tasks.temporaryGroup.isCreated = true;
      
      var task = new Task(container.currentGid);
      task.setTopic('临时对讲');
      task.setEventType(_const.TASK_TYPE.TEMPORARY_GROUP);
      container.tasks.put(task);
      container.tasks.temporaryGroup.hideCreateTGDialogInfo();
      container.tasks.temporaryGroup.initTGDialog(container.tasks.temporaryGroup.selectedMap); 
      $('#selectTemporaryGroup').modal('hide');
      container.joinGroup(container.currentGid, _const.PTT_TYPE.TEMPORARY_GROUP);
    }else{
      container.tasks.temporaryGroup.hideCreateTGDialogInfo();
      console.log(msg);
      container.tasks.temporaryGroup.showCreateTGDialogError(fnError.wsError(msg.body.err));
    }
  }

  var temporaryTalkHangUpHandler = function(container, msg){
     if(msg.body.err === _const.WS.RLT.OK){
       container.tasks.remove(msg.body.gid);  
       container.exitGroup();    
       container.joinBeforeGroup();
     }else{
       container.tasks.currentId = undefined;
     }
  }

  //8025
  var temporaryTalkAddHandler = function(container, msg){
    if(msg){
      container.tasks.temporaryGroup.hideAddTGDialogInfo();
      container.tasks.temporaryGroup.initTGDialog(container.tasks.temporaryGroup.selectedMap);
      // container.tasks.temporaryGroup.openTGDialog(); 
      $('div[role="dialog"]').modal('hide');
    }
  }

  // 24
  var exitAllHandler = function(container, msg){
    if(msg){
      var cid = msg.body.cid;
      var sid = msg.body.sid;
      var stat = msg.body.stat;
      var gid = msg.body.gid;
      var uid = msg.body.uid;
      var type = msg.body.type;
      // 1:对讲；2:会议；3：广播；4：单呼；5：临时组
      switch(type){
        //1:对讲
        case 1:
          container.joinGroup(container.currentGid, _const.PTT_TYPE.TALKING);
          break;
        //2:会议
        case 2:
          fnModal._alertStat(stat);
          fnUtils.goBackTalk(container, gid);
          container.joinBeforeGroup();
          container.slidebar.enableRAll();
          break;
        //3：广播
        case 3:
          fnModal._alertStat(stat);
          fnUtils.goBackTalk(container, gid);
          container.joinBeforeGroup();
          container.slidebar.enableRAll();
          break;
        //4：单呼
        case 4:
          fnModal._alertStat(stat);
          fnUtils.goBackTalk(container, gid);
          container.joinBeforeGroup();
          container.slidebar.enableRAll();
          break;
        //5：临时组
        case 5:
          fnModal._alertStat(stat);
          fnUtils.goBackTalk(container, gid);
          container.joinBeforeGroup();
          break;
        default:
      }
    }
  }

  //9001
  var groupChangeHandler = function(container, msg){
    var gid = msg.body.gid;
    var defaultGid = msg.body.defaultGid;
    var uid = parseInt(msg.body.uid);
    var action = msg.body.action;
    var userName = msg.body.userName;
    var tipStr = msg.body.tipStr;
    if(uid === container.uid){//组操作
      if(defaultGid){
        container.slidebar.defaultGroup = defaultGid;
      }
      if(action && action === -1){ //移除组/冻结组/加入组
        // 判断是否是当前对讲组
        // 挂断对讲
        if(gid === container.currentGid){
          container.exitGroup();
        }
        //判断是否是默认组
        if(gid === container.slidebar.defaultGroup){
          container.slidebar.defaultGroup = undefined;
        }
        container.slidebar.removeGroup(gid);

      }else{//添加组,激活组
        container.slidebar.addGroup(gid);
      }
    }else{
      if(gid === -1 || gid === ''){//禁用
        if(action === -1){
          container.slidebar.uncheckGMSM(uid);
          container.slidebar.removeMember(-1, uid);
        }
      }else{//启用
        if(action === -1){
          container.slidebar.removeMember(gid, uid);
        }else{
          container.slidebar.addMember(gid, uid, container);
        }
      }
    }
  }

  var userChangeHandler = function(container, msg){
    fnUtils.logout(container.uid, container.cmpid, container.key, function(data){
    }, function(e){
      console.log(e);
    });
    container.rtpWs.exitRtp();
    setTimeout(function(){
      fnUtils.exitDispatcher(container);
      $('.danger-bar-info').html(msg.body.tipStr + ', 点击确定系统登出!');
      $('#returnLoginModal').modal('show');
    },3000);
  }

  // 9001
  var onLineHandler = function(container, msg){
    var uid = msg.body.uid;
    container.slidebar.online(uid);
    container.slidebar.map.online(uid);
  }

   // 9002
  var offLineHandler = function(container, msg){
    var uid = msg.body.uid;
    container.slidebar.offline(uid);
    container.slidebar.map.offline(uid);
  }

  // 9003
  var cutSetHandler = function(container, msg){
    var uid = msg.body.uid;
    var gid = msg.body.gid;
    var type = msg.body.type;

    if(type === _const.PTT_TYPE.TALKING ){
      container.slidebar.cutSet(gid, uid);
    }else if(type === _const.PTT_TYPE.TEMPORARY_GROUP && gid !== container.tasks.currentId){
      if(gid===0){
        container.tasks.temporaryGroup.memberLevelTG(uid);
      }
      container.slidebar.cutSet(gid, uid);
    }else if(type === _const.PTT_TYPE.TEMPORARY_GROUP && gid === container.tasks.currentId){
      container.tasks.temporaryGroup.joinedMembers[uid] = uid;
      container.slidebar.cutSet(0, uid);
    }else if(type === _const.PTT_TYPE.SINGLE_CALL){
      if(gid === 0 && container.tasks.singleCalledUid === uid){
        container.tasks.remove(container.tasks.currentId);
        container.exitGroup();
        container.joinBeforeGroup();
      }
      container.slidebar.cutSet(0, uid);
    }else{
      container.slidebar.cutSet(gid, uid);
    }
    container.slidebar.map.online(uid);
  }

  var adminUserDisableHandler = function(container, msg){
    var uid = msg.body.uid;
    if(uid === container.uid){
      fnUtils.exitDispatcher(container);
      $('.danger-bar-info').html('账号被管理员禁用,点击确定返回至登陆界面!');
      $('#returnLoginModal').modal('show');
    }else{
      container.slidebar.memberDisable(msg.body.uid);
    }
  }

  var adminUserEnableHandler = function(container, msg){
    container.slidebar.memberEnable(msg.body.uid);
  }

  var adminUserDelHandler = function(container, msg){
    var uid = msg.body.uid;
    if(uid === container.uid){
      fnUtils.exitDispatcher(container);
      $('.danger-bar-info').html('账号被后台删除,请联系管理员!');
      $('#returnLoginModal').modal('show');
    }else{
      container.slidebar.deleteMember(msg.body.uid);
    }
  }

  var adminUserPwdResetHandler = function(container, msg){
     var uid = msg.body.uid;
     if(uid === container.uid){
       fnUtils.exitDispatcher(container);
       $('.danger-bar-info').html('账号密码更新,点击确定返回登入页面!');
       $('#returnLoginModal').modal('show');
     }else{
        container.slidebar.offline(uid);
     }
  }

  var adminGroupDisableHandler = function(container, msg){
    var gid = msg.body.gid;
    container.slidebar.groupDisable(msg.body.gid);
  }

  var adminGroupEnableHandler = function(container, msg){
    container.slidebar.groupEnable(msg.body.gid);
  }

  var adminGroupDelHandler = function(container, msg){
    var gid = msg.body.gid;
    container.slidebar.groupDelete(msg.body.gid);
  }

  var adminGroupUserLeave = function(container, msg){
    var uid = msg.body.uid;
    var gid = msg.body.gid;
    if(uid === container.uid){
      container.slidebar.groupDelete(msg.body.gid);
    }else{
      container.slidebar.removeMember(gid, uid);
    }
  }

  var adminGroupUserJoin = function(container, msg){
    var uid = msg.body.uid;
    var gid = msg.body.gid;
    if(uid === container.uid){
      container.slidebar.addGroup(gid);
    }else{
      container.slidebar.addMember(gid, uid);
    }
    
  }
  var pushUploadPhotoMessage=function(container,msg,uname){

    var cmpid=msg.body._company_id;
    var cmpid1 = fnUtils.getQueryString('companyId');
    var cmpData;
    var uid1 = fnUtils.getQueryString('userid');
    var uid=msg.body._user_id;
    var msgid=msg.body._message_id;
    var key = fnUtils.getQueryString('userToken');
    var theme=msg.body._theme;
    var iNum=parseInt($('.instant-message i').html());
    var defaultGid = fnUtils.getQueryString('defaultGid');
    if($('#message-pop').css('display')=='none'&&$('#single-message').css('display')=='none'){
      fnUtils.groupMemberLocationsQuery(uid1, cmpid1, key, function(data) {
        cmpData = fnData.formatData(data, uid1, defaultGid);
        console.log(cmpData);
        for(var a=0;a<cmpData.length;a++){
          for(var b=0;b<cmpData[a].members.inOther.length;b++){
            if(uid==cmpData[a].members.inOther[b].memberId){
              uname=cmpData[a].members.inOther[b].memberName;
              break;
            }
          }
          if (!uname) {
            for (var c = 0; c < cmpData[a].members.offline.length; c++) {
              if (uid== cmpData[a].members.offline[c].memberId) {
                uname = cmpData[a].members.offline[c].memberName;
                break;
              }
            }
          }
        }

        setTimeout(function(){
          $('#slidesway .check').attr('data-imgid',msgid);
          $('#slidesway .message-title').html(uname+'发来图片');
          $('#single-message .message-title').html(uname+'发来图片');
          $('#slidesway .theme').html(theme);
          $('#slidesway').animate({
            'right':'70px'
          },500);
        },200);
      });
      setTimeout(function(){
        if($('#slidesway').css('right')=='70px'){
          iNum++;
          if(iNum>99){
            $('.instant-message b').css('display','block');
          }else{
            $('.instant-message i').css('display','block').html(iNum);
          }
        }
        $('#slidesway').animate({
          'right':'-300px'
        },500);
      },5000);
    }else if($('#message-pop').css('display')=='none'&&$('#single-message').css('display')=='block'){
     iNum++;
      if(iNum>99){
        $('.instant-message b').css('display','block');
      }else{
        $('.instant-message i').css('display','block').html(iNum);
      }
    }else{
      if(iNum!=0){
        $('.instant-message i').css('display','block');
      };
      var msgNum=parseInt($('#small-box .num').html());
      if(msgNum!=0){$('#small-box').fadeOut(200);}
      msgNum++;
      $('#small-box .num').html(msgNum);
      $('#small-box .watch').attr('data-imgid',msgid);
      $('#small-box').fadeIn(500);
    };
  };
  var otherHandler = function(msg){
  	if(_const.debug){
      console.log('=========== otherHandler() ==========');
  	}
  }

  exports.getAccessMsg = getAccessMsg,
  exports.getHeartBeatMsg = getHeartBeatMsg,
  exports.getInChannelMsg = getInChannelMsg,
  exports.getOutChannelMsg =  getOutChannelMsg,
  exports.getVideoSingleCallMsg = getVideoSingleCallMsg,
  exports.get_videoSingleCallHangUpMsg = get_videoSingleCallHangUpMsg,
  exports.getVideoSingleCallHangUpMsg = getVideoSingleCallHangUpMsg,
  exports.getBoardcastMsg = getBoardcastMsg,
  exports.getBoardcastHangUpMsg = getBoardcastHangUpMsg,
  exports.getPushLbsMsg = getPushLbsMsg,
  exports.getTemporaryTalkMsg = getTemporaryTalkMsg,
  exports.getTemporaryTalkAddMsg = getTemporaryTalkAddMsg,
  exports.getTemporaryTalkHangUpMsg = getTemporaryTalkHangUpMsg,
  exports.getRTPMsg = getRTPMsg,
  exports.getOtherMsg = getOtherMsg,
  
  // ====== handler
  exports.accessHandler = accessHandler,
  exports.heartBeatHandler = heartBeatHandler,
  exports.inChannelHandler = inChannelHandler,
  exports.outChannelHandler = outChannelHandler,
  exports._stashPopHandler = _stashPopHandler,
  exports.videoSingleCallHandler = videoSingleCallHandler,
  exports.videoSingleCallHangUpHandler = videoSingleCallHangUpHandler,
  exports._videoSingleCallHangUpHandler = _videoSingleCallHangUpHandler,
  exports.pullLbsHandler = pullLbsHandler,
  exports.boardcastHandler = boardcastHandler,
  exports.boardcastHangUpHandler = boardcastHangUpHandler,
  exports.temporaryTalkHandler = temporaryTalkHandler,
  exports.temporaryTalkHangUpHandler = temporaryTalkHangUpHandler,
  exports.temporaryTalkAddHandler = temporaryTalkAddHandler,
  exports.groupChangeHandler = groupChangeHandler,
  exports.exitAllHandler = exitAllHandler,
  exports.userChangeHandler = userChangeHandler,
  exports.onLineHandler = onLineHandler,
  exports.cutSetHandler = cutSetHandler,
  exports.offLineHandler = offLineHandler,
  exports.adminUserPwdResetHandler = adminUserPwdResetHandler,
  exports.adminUserDisableHandler = adminUserDisableHandler,
  exports.adminUserEnableHandler = adminUserEnableHandler,
  exports.adminUserDelHandler = adminUserDelHandler,
  exports.adminGroupDisableHandler = adminGroupDisableHandler,
  exports.adminGroupEnableHandler = adminGroupEnableHandler,
  exports.adminGroupDelHandler = adminGroupDelHandler,
  exports.adminGroupUserLeave = adminGroupUserLeave,
  exports.adminGroupUserJoin = adminGroupUserJoin,
  exports.pushUploadPhotoMessage=pushUploadPhotoMessage,
  exports.otherHandler = otherHandler
});